<div class="Page">
<?php

$index = $this->pages['index'];//当前页数
$pagesize = $this->pages['pagesize'];//每页记录条数
$pages = $this->pages['pages'];//
$size = $this->pages['size'];//总页数

if($index==0){ 
   echo '<span class="PageStart">上一页</span>';
}else{
    echo '<a href="?start='.($index-1)*$pagesize.'&'.$this->pamas.'"">上一页</a>';

}
if($pages<7){
    for($i=0;$i<$pages;$i++){
        if ($index==$i)
            echo '<span class="PageCur">'.($index+1).'</span>';
        else 
            echo '<a href="?start='.($i*$pagesize).'&'.$this->pamas.'">'. ($i+1) .'</a>';    
    }
}else{
    if($index <6){
        for($i=0;$i<7;$i++){
            if ($index==$i) echo '<span class="PageCur">'.($index+1).'</span>';
            else echo '<a href="?start='.($i*$pagesize).'&'.$this->pamas.'">'. ($i+1) .'</a>'; 
        }
        echo '<a href="?start='.(($index+4)*$pagesize).'&'.$this->pamas.'">···</a>'; 
        echo '<a href="?start='.(($pages-3)*$pagesize).'&'.$this->pamas.'">'. ($pages-2) .'</a>';
        echo '<a href="?start='.(($pages-2)*$pagesize).'&'.$this->pamas.'">'. ($pages-1) .'</a>';
        echo '<a href="?start='.(($pages-1)*$pagesize).'&'.$this->pamas.'">'. $pages .'</a>';
    }else if($index>=6 && $index<=($pages-7)){
        echo '<a href="?start=0&'.$this->pamas.'">1</a>';
        echo '<a href="?start='.(2*$pagesize).'&'.$this->pamas.'">2</a>';
        echo '<a href="?start='.(3*$pagesize).'&'.$this->pamas.'">3</a>';
        echo '<a href="?start='.(($index-4)*$pagesize).'&'.$this->pamas.'">···</a>'; 
        echo '<a href="?start='.(($index-2)*$pagesize).'&'.$this->pamas.'">'. ($index-1) .'</a>';
        echo '<a href="?start='.(($index-1)*$pagesize).'&'.$this->pamas.'">'. ($index) .'</a>';
        echo '<span class="PageCur">'.($index+1).'</span>';
        echo '<a href="?start='.(($index+1)*$pagesize).'&'.$this->pamas.'">'. ($index+2) .'</a>';
        echo '<a href="?start='.(($index+2)*$pagesize).'&'.$this->pamas.'">'. ($index+3) .'</a>';
        echo '<a href="?start='.(($index+4)*$pagesize).'&'.$this->pamas.'">···</a>'; 
        echo '<a href="?start='.(($pages-3)*$pagesize).'&'.$this->pamas.'">'. ($pages-2) .'</a>';
        echo '<a href="?start='.(($pages-2)*$pagesize).'&'.$this->pamas.'">'. ($pages-1) .'</a>';
        echo '<a href="?start='.(($pages-1)*$pagesize).'&'.$this->pamas.'">'. $pages .'</a>';
    }else if($index>($pages-7)){
        echo '<a href="?start=0&'.$this->pamas.'">1</a>';
        echo '<a href="?start='.(2*$pagesize).'&'.$this->pamas.'">2</a>';
        echo '<a href="?start='.(3*$pagesize).'&'.$this->pamas.'">3</a>';
        echo '<a href="?start='.((ceil($index/2)-1)*$pagesize).'&'.$this->pamas.'">···</a>'; 
        for($i=($pages-7);$i<$pages;$i++){
            if ($index==$i) echo '<span class="PageCur">'.($index+1).'</span>';
            else echo '<a href="?start='.($i*$pagesize).'&'.$this->pamas.'">'. ($i+1) .'</a>'; 
        }
    } 
}
    
if(($this->pages['index'] +1)*$this->pages['pagesize'] < $this->pages['size']){
    echo '<a href="?start='.(($this->pages['index']+1)*$this->pages['pagesize']).'&'.$this->pamas.'">下一页</a>';
}else{
    echo '<span class="PageStart">下一页</span>';       
}
?>
    
</div>
<?php echo $this->formHidden('start') ?>
